﻿using HandyControl.Controls;
using HandyControl.Tools;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Random
{
    /// <summary>
    /// sprite.xaml 的交互逻辑
    /// </summary>
    public partial class AppSprite
    {
        public int min { set; get; } = 1;
        public int max { set; get; } = 2;

        public int hang { set; get; } = 6;
        public bool ishang { set; get; } = true;
        public int lie { set; get; } = 8;
        public bool islie { set; get; } = true;
        public AppSprite()
        {
            InitializeComponent();
        }

        private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (!GlobalVariables.spriteIsGo2)
            {
                System.Random rd = new System.Random();
                Growl.InfoGlobal(Convert.ToString(rd.Next(min, max + 1)));
            }
            else
            {
                System.Random rd = new System.Random();
                int 行num;
                int 列num;
                if (ishang == true && islie == true)
                {
                    行num = rd.Next(1, hang + 1);
                    列num = rd.Next(1, lie + 1);
                    Growl.InfoGlobal(Convert.ToString(列num) + "列" + Convert.ToString(行num) + "行");
                }
                else
                {
                    if (islie == true && ishang == false)
                    {
                        行num = rd.Next(1, hang + 1);
                        Growl.InfoGlobal(Convert.ToString(行num) + "行");
                    }
                    else
                    {
                        if (ishang == false && islie == true)
                        {
                            列num = rd.Next(1, lie + 1);
                            Growl.InfoGlobal(Convert.ToString(列num) + "列");
                        }
                    }
                }
            }
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            GlobalVariables.isSpriteOpen = false;
        }
    }
}
